<?php
$AppUI->savePlace();
$perms =& $AppUI->acl();
$role_id = $_GET['role_id'];
$role = $perms->getRole($role_id);

if (isset($_GET['tab'])) {
	$AppUI->setState('RoleVwTab', $_GET['tab']);
}
$tab = $AppUI->getState('RoleVwTab') !== NULL ? $AppUI->getState('RoleVwTab') : 0;

if (! is_array($role)) {
	$titleBlock = new CTitleBlock('Invalid Role', 'roles-settings.png');
	$titleBlock->addButton('role list', '?m=system&u=roles');
	$titleBlcok->show();
} else {
	$titleBlock = new CTitleBlock('View Role', 'roles-settings.png');
	$titleBlock->addButton('role list', '?m=system&u=roles');
	$titleBlock->show();
?>
<?php
	$tabBox = new CTabBox("?m=system&u=roles&a=viewrole&role_id=$role_id", $tab );
	$tabBox->add( 'vw_role_perms', 'Permissions');
	$tabBox->setInfo(
		'<table border="0" cellpadding="4" cellspacing="0" width="100%" class="internal">'.
		'<tr>'.
			'<td align="right" nowrap><b>'.$AppUI->_('Role ID').':</b></td>'.
			'<td width="100%">'.$role['value'].'</td>'.
			'<td rowspan="2"><input type="button" value="'.$AppUI->_('Add permission').'" onclick="doAddPermission()"></td>'.
		'</tr>'.
		'<tr>'.
			'<td align="right"><b>'.$AppUI->_('Description').':</b></td>'.
			'<td width="100%">'.$AppUI->_($role['name']).'</td>'.
		'</tr>'.
		'</table>'
	);
	$tabBox->show();
} // End of check for valid role
?>
